package com.smfx.yxt.controller.sys.kccs;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smfx.yxt.common.AdminUser;
import com.smfx.yxt.common.RspResult;
import com.smfx.yxt.common.enums.Status;
import com.smfx.yxt.controller.BaseController;
import com.smfx.yxt.model.CourseClassDate;
import com.smfx.yxt.model.Grid;
import com.smfx.yxt.model.KccsCourseInfo;
import com.smfx.yxt.model.TeacherInfo;
import com.smfx.yxt.page.OrderBy;
import com.smfx.yxt.page.Page;
import com.smfx.yxt.reqVo.KccsCourseQueryVO;
import com.smfx.yxt.service.IKccsCourseInfoService;

@RequestMapping("/sys/course/classDateConf")
@Controller
public class SysCourseClassDateConfController extends BaseController {

	@Autowired
	private IKccsCourseInfoService kccsCourseInfoService;
	
	@RequestMapping(value={"","/"})
	public String Index() {
		return "sys/kccs/classDateConf";
	}
	
	@RequestMapping("pageQuery")
	@ResponseBody Object pageQuery(KccsCourseQueryVO vo){
		try {
			CourseClassDate record = kccsCourseInfoService.selectCourseClassDate();
			List<CourseClassDate> list = new ArrayList<>();
			list.add(record);
			Grid grid = new Grid();
			grid.setRows(list);
			grid.setTotal(list.size());
			return grid;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@RequestMapping("addUpdate")
	@ResponseBody Object pageQuery(CourseClassDate record){
		try {
			kccsCourseInfoService.updateCourseClassDate(record);
			return new RspResult(Status.SUCCESS);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return new RspResult(Status.FAIL);
	}
	
}
